from  selenium.webdriver.common.by import By
from  base.base_page import BasePage

class CommentPage(BasePage):
    def __init__(self):
        super().__init__()
        # 评论
        self.pinlun = (By.XPATH,
                       "//*[@id='app']/div[1]/section/div/div[3]/div[2]/i")
        self.pinlun_neirong = (By.XPATH,
                               "//*[@id='app']/div[1]/section/div/div[4]/div[2]/textarea")
        self.pinlun_fenshu = (By.XPATH,
                              "//*[@id='app']/div[1]/section/div/div[4]/div[1]/div/span[5]/i")
        self.pinlun_fasong = (By.XPATH,
                              "//*[@id='app']/div[1]/section/div/div[4]/div[3]/button")

        # 点击评论
    def home_to_pinlun(self, neirong):
            self.find_el(self.pinlun).click()
            self.find_el(self.pinlun_neirong).clear()
            self.find_el(self.pinlun_neirong).send_keys(neirong)
            self.find_el(self.pinlun_fenshu).click()
            self.find_el(self.pinlun_fasong).click()
